import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/main'
  },
  {
    path: '/main',
    name: 'Main',
    redirect: '/home',
    component: () => import('views/Main/Main.vue'),
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () => import('views/Main/Home/Home.vue')
      },
      {
        path: '/gonglue',
        name: 'Gonglue',
        component: () => import('views/Main/Gonglue/Gonglue.vue')
      },
      {
        path: '/saishi',
        name: 'Saishi',
        component: () => import('views/Main/Saishi/Saishi.vue')
      },
      {
        path: '/articles/:id',
        name: 'Article',
        component: () => import('views/Main/Home/Article/Article.vue'),
        props: true
      }
    ]
  },
  {
    path: '/heros/:id',
    name: 'Hero',
    component: () => import('views/Main/Home/Hero/Hero.vue'),
    props: true
  }
]

const router = new VueRouter({
  routes
})

export default router
